<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>EOS.IO: contracts/eoslib/dispatcher.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="eos-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">EOS.IO
   &#160;<span id="projectnumber">DAWN3.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ae9b15dd87e066e1908bbd90e8f38627.html">contracts</a></li><li class="navelem"><a class="el" href="dir_3fea0bf1ce879ce73e6ecec98007efcd.html">eoslib</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">dispatcher.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="dispatcher_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="print_8hpp.html">eoslib/print.hpp</a>&gt;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;</div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceeosio.html">eosio</a> {</div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Contract, <span class="keyword">typename</span> FirstAction&gt;</div><div class="line"><a name="l00006"></a><span class="lineno"><a class="line" href="namespaceeosio.html#a78b2709044b48bb39105d37d787fefea">    6</a></span>&#160;   <span class="keywordtype">bool</span> <a class="code" href="namespaceeosio.html#a78b2709044b48bb39105d37d787fefea">dispatch</a>( <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> code, <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> act ) {</div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;      <span class="keywordflow">if</span>( code == <a class="code" href="namespacedice.html#ae09b3a3f877447164f939f485592fc91">FirstAction::get_account</a>() &amp;&amp; FirstAction::get_name() == act ) {</div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;         <a class="code" href="namespaceeosiosystem.html#a8a502c589b78b453338d6b2c5b4f405d">Contract::on</a>( unpack_action&lt;FirstAction&gt;() );</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;         <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;      }</div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;      <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;   }</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;   <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Contract, <span class="keyword">typename</span> FirstAction, <span class="keyword">typename</span> SecondAction, <span class="keyword">typename</span>... Actions&gt;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="namespaceeosio.html#a289285490058d17de4a6a052b52dd680">   26</a></span>&#160;   <span class="keywordtype">bool</span> <a class="code" href="namespaceeosio.html#a78b2709044b48bb39105d37d787fefea">dispatch</a>( <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> code, <a class="code" href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a> act ) {</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;      <span class="keywordflow">if</span>( code == <a class="code" href="namespacedice.html#ae09b3a3f877447164f939f485592fc91">FirstAction::get_account</a>() &amp;&amp; FirstAction::get_name() == act ) {</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;         <a class="code" href="namespaceeosiosystem.html#a8a502c589b78b453338d6b2c5b4f405d">Contract::on</a>( unpack_action&lt;FirstAction&gt;() );</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;         <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;      }</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="namespaceeosio.html#a78b2709044b48bb39105d37d787fefea">eosio::dispatch</a>&lt;Contract,SecondAction,Actions...&gt;( code, act );</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;   }</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;}</div><div class="ttc" id="namespaceeosiosystem_html_a8a502c589b78b453338d6b2c5b4f405d"><div class="ttname"><a href="namespaceeosiosystem.html#a8a502c589b78b453338d6b2c5b4f405d">eosiosystem::on</a></div><div class="ttdeci">void on(const eosiosystem::transfer &amp;act)</div><div class="ttdef"><b>Definition:</b> eosio.system.cpp:14</div></div>
<div class="ttc" id="namespaceeosio_html"><div class="ttname"><a href="namespaceeosio.html">eosio</a></div><div class="ttdoc">Used to forward declare raw functions. </div><div class="ttdef"><b>Definition:</b> account.hpp:12</div></div>
<div class="ttc" id="print_8hpp_html"><div class="ttname"><a href="print_8hpp.html">print.hpp</a></div></div>
<div class="ttc" id="namespaceeosio_html_a78b2709044b48bb39105d37d787fefea"><div class="ttname"><a href="namespaceeosio.html#a78b2709044b48bb39105d37d787fefea">eosio::dispatch</a></div><div class="ttdeci">bool dispatch(uint64_t code, uint64_t act)</div><div class="ttdef"><b>Definition:</b> dispatcher.hpp:6</div></div>
<div class="ttc" id="group__types_html_gaaa5d1cd013383c889537491c3cfd9aad"><div class="ttname"><a href="group__types.html#gaaa5d1cd013383c889537491c3cfd9aad">uint64_t</a></div><div class="ttdeci">unsigned long long uint64_t</div><div class="ttdef"><b>Definition:</b> types.h:18</div></div>
<div class="ttc" id="namespacedice_html_ae09b3a3f877447164f939f485592fc91"><div class="ttname"><a href="namespacedice.html#ae09b3a3f877447164f939f485592fc91">dice::get_account</a></div><div class="ttdeci">account get_account(account_name owner)</div><div class="ttdef"><b>Definition:</b> dice.hpp:88</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
